if … else
Pascal
C/C++
w
if x < 0 then
w
x := -x
if (x < 0)
x = -x;
l
if (x > y) then
max := x
else
max := y
if (x > y)
max = x;
else
max = y;
l
This is used to decide whether to do something at a special point, or to decide between two courses of action.
Note: In C, a semicolon is a statement terminator, not a statement separator – so it MUST be used before else in a case like this.